<?php $this->header(); ?>
<div class="wrap">

    <!-- start -->
    <div class="nav">
        <ul class="cc">
            <li ><a href="/?g=Admin&m=Model&a=index">模型列表</a></li>
            <li><a href="/?g=Admin&m=Model&a=field&model_id=<?php echo $_GET['model_id']; ?>">字段列表</a></li>
            <li class="current"><a href="<?php echo $url; ?>"><?php if (empty($_GET['id'])): ?>添加字段<?php else: ?>编辑字段<?php endif; ?></a></li>
        </ul>
    </div>
    <form class="J_ajaxForm" action="<?php echo $actionUrl; ?>" method="post" enctype="multipart/form-data">
        <div class="h_a">字段设置</div>
        <div class="table_full">
            <table width="100%">
                <col class="th" />
                <col/>

                <tr>
                    <th>字段类型</th>
                    <td>
                        <?php if (empty($_GET['id'])): ?>
                            <select name="type"><?php echo $formtype; ?></select>
                        <?php else: ?>
                            <?php echo $func->fieldType($type); ?>
                        <?php endif; ?>
                    </td>
                </tr>
                <tr>
                    <th>字段名称</th>
                    <td>
                        <?php if (empty($_GET['id'])): ?>
                            <input name="field_name" type="text" class="input length_5" aria-label="" accesskey="" placeholder="" speech="" value="">
                        <?php else: ?>
                            <?php echo $field_name; ?>
                        <?php endif; ?>

                    </td>
                </tr>
                <tr>
                    <th>中文名称</th>
                    <td>
                        <input name="name" type="text" class="input length_5" aria-label="" accesskey="" placeholder="" speech="" value="<?php echo $name; ?>">
                    </td>
                </tr>
                <tr>
                    <th>默认值</th>
                    <td>
                        <input name="default" type="text" class="input length_5" aria-label="" accesskey="" placeholder="" speech="" value="<?php echo $default; ?>">
                    </td>
                </tr>
                <tr>
                    <th>选项</th>
                    <td>
                        <textarea name="option" rows="5" cols="54" ><?php echo $option; ?></textarea>
                        <div class="fun_tips">此处若没有特殊说明，必须 <font color="red">值|名称</font>调用且一行一个选项值，否则将无法提交!</div>
                        <div class="fun_tips"><font color="blue" style=" font-weight: bold">注意:</font><font color="#008800">目前选项适用于单选，复选，下拉菜单。其余功能填写也不会产生任何实际效果。</font></div>
                    </td>
                </tr>
                <tr>
                    <th>提示信息</th>
                    <td>
                        <input name="message" type="text" class="input length_5" aria-label="" accesskey="" placeholder="" speech="" value="<?php echo $message; ?>">
                        <div class="fun_tips">当表单为必填时，若提交内容为空时，系统则会调用此提示信息。默认内容为：“字段名称”为必填项。</div>
                    </td>
                </tr>
                <tr>
                    <th>是否必填</th>
                    <td>
                        <label><input type="radio" name="required" value="0" <?php if (!empty($_GET['id']) && $required == 0): ?>checked="checked"<?php endif; ?>><span>否</span></label>
                        <label><input type="radio" name="required" value="1" <?php if (!empty($_GET['id']) && $required == 1): ?>checked="checked"<?php elseif (empty($_GET['id'])): ?>checked="checked"<?php endif; ?>><span>是</span></label>
                    </td>
                </tr>
                <tr>
                    <th>过滤状态</th>
                    <td>
                        <label><input type="radio" name="htmlentities" value="1" <?php if (!empty($_GET['id']) && $htmlentities == 1): ?>checked="checked"<?php endif; ?>><span>否</span></label>
                        <label><input type="radio" name="htmlentities" value="0" <?php if (!empty($_GET['id']) && $htmlentities == 0): ?>checked="checked"<?php elseif (empty($_GET['id'])): ?>checked="checked"<?php endif; ?>><span>是</span></label>
                        <div class="fun_tips">此处指的是HTML标签;例如编辑器是不进行过滤的</div>
                    </td>
                </tr>
                <tr>
                    <th>排序</th>
                    <td>
                        <input name="listsort" type="text" class="input length_1" aria-label="" accesskey="" placeholder="" speech="" value="<?php echo $listsort; ?>">
                    </td>
                </tr>
                <tr>
                    <th>启用状态</th>
                    <td>
                        <label><input type="radio" name="status" value="0" <?php if (!empty($_GET['id']) && $status == 0): ?>checked="checked"<?php endif; ?>><span>禁用</span></label>
                        <label><input type="radio" name="status" value="1" <?php if (!empty($_GET['id']) && $status == 1): ?>checked="checked"<?php elseif (empty($_GET['id'])): ?>checked="checked"<?php endif; ?>><span>启用</span></label>
                    </td>
                </tr>

            </table>
        </div>
        <div class="btn_wrap">
            <div class="btn_wrap_pd">
                <button type="submit" class="btn btn_submit J_ajax_submit_btn">提交</button>
            </div>
        </div>
    </form>

    <!-- end -->

</div>

<?php $this->footer(); ?>